
let china = echarts.init($('.china .geo')[0], {renderer: 'canvas'})
china.setOption(option_china_map_get)

let hubei = echarts.init($('.map .geo')[0], {renderer: 'canvas'})
hubei.setOption(option_hubei_map)

let pie = echarts.init($('.pie')[0], {renderer: 'canvas'});
pie.setOption(option_china_radar_get);

let point = echarts.init($('.doubleline .line')[0], {renderer: 'canvas'});
point.setOption(option_china_point)

let modal = echarts.init($('.modal .chart')[0], {renderer: 'canvas'});
modal.setOption(option_china_map_get)


$(document).ready(function(){

    $('.modal .close svg').on('click',function(){
        $('.mask').css('display','none')
        $('.modal').css('display','none')
    })
    $('.chart svg').on('click',function(e){
        if(e.target.nodeName !== "svg")
            return false
        e.stopPropagation();
        const index = e.target.dataset.index
        let option = option_china_map_get;
        switch(index){
            case "china":
                option = option_china_map_get
                break
            case "hubei":
                option = option_hubei_map
                break
            case "point":
                option = option_china_point
                break
            case "radar":
                option = option_china_radar_get
                break
        }
        $('.mask').css('display','block')
        $('.modal').css('display','block')
        modal.setOption(option,'chalk', {renderer: 'canvas'})
    })

    $('.column .btns a').on('click',function(){
        alert("功能即将上线，敬请期待！")
    })
})